
package milu.servlets;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.*;

import com.google.appengine.api.users.*;

public class Logout extends HttpServlet {
    UserService userService = UserServiceFactory.getUserService();

	public void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
        String returnUrl = request.getParameter("returnurl");
        if(returnUrl == null) returnUrl = "/";

        HttpSession session = request.getSession(true);
        session.invalidate(); 
        response.sendRedirect(returnUrl);
    }

}
